Skip to content

feat: add Ghostty notification system support#36

Open
LukasdeBoer wants to merge 1 commit intomohak34:mainfrom
LukasdeBoer:feat/ghostty-notification-system
Open

feat: add Ghostty notification system support#36
LukasdeBoer wants to merge 1 commit intomohak34:mainfrom
LukasdeBoer:feat/ghostty-notification-system

Conversation

@LukasdeBoer
Copy link

@LukasdeBoer LukasdeBoer commented Feb 26, 2026

Summary

  • Adds "ghostty" as a new notificationSystem option alongside "osascript" and "node-notifier"
  • Uses the OSC 777 escape sequence (\e]777;notify;title;body\a) to send notifications natively through Ghostty terminal
  • Clicking notifications brings the Ghostty window to the foreground, unlike osascript which opens Script Editor

Usage

Set in ~/.config/opencode/opencode-notifier.json:

{
  "notificationSystem": "ghostty"
}

Changes

  • src/config.ts: Added "ghostty" to the notificationSystem type union and config parsing
  • src/notify.ts: Added Ghostty handler that writes the OSC 777 escape sequence to stdout, with sanitization of control characters (;, BEL, ESC)

Testing

Tested locally on macOS with Ghostty — notifications appear as native macOS notifications from Ghostty, and clicking them correctly brings the terminal window to the foreground, even to the correct tab if you have multiple opencodes running simultaneously.

Add 'ghostty' as a notification system option that uses the OSC 777
escape sequence to send notifications natively through Ghostty terminal.
This allows clicking notifications to bring the Ghostty window to the
foreground, unlike osascript which opens Script Editor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant